//By Francois Budin
#ifndef Matrix_h
#define Matrix_h

#include "TabND.h"
#include "Vector.h"


namespace FPTK{

	template<class T>
    class Matrix:public TabND<T>
	{
    public:
       Matrix(long _R,long _C);
       ~Matrix();
       void SetId();
       //template<class C> Matrix<C> Cast();
       template<class C> operator Matrix<C> const() const;
       Matrix<T> operator+(const Matrix<T>& m2) const;
       template<class S> Matrix<T> operator*(S f) const;
       Matrix<T> operator*(const Matrix<T>& m2) const;
       Vector<T> operator*(const Vector<T>& v) const;
       Vector<T> GetVector(long c) const;
       void SetVector(long c,const Vector<T>& v);
       void SetAllVector(long nb,Vector<T>* v1,...);
       friend std::ostream& operator<<(std::ostream& os,const Matrix<T>& obj)
       {    
          for(int i=0;i<obj.GetSizeDim(0);i++)
          {
             for(int j=0;j<obj.GetSizeDim(1);j++)
             {
                os<<obj.GetElement(i,j)<<" ";
             }
             os<<std::endl;
          }
          return os;
       }
    private:
        Matrix<T> operator=(Vector<T> v);
        Matrix<T>(Vector<T> v);
    };

} //end namespace FPTK

#include "Matrix.cxx"

#endif